package com.uzhie.jt808.msg;

import io.netty.buffer.ByteBufUtil;

import java.io.Serializable;

/**
 * Created by TangFei on 2018/7/16.
 */
public class JT808MsgHeaderBean implements Serializable {

    private int msgID;

    private int bodyLength;
    private int encrypt;
    private boolean hasSubPakage;

    private String simNum;
    private int flowNum;

    private int totalSubPackage;
    private int numSubPackage;

    public int getMsgID() {
        return msgID;
    }

    public void setMsgID(int msgID) {
        this.msgID = msgID;
    }

    /**
     * 获取16进制字符串格式的消息ID
     *
     * @return hex string
     */
    public String getHexMsgID() {
        byte[] bytes = new byte[2];
        bytes[0] = (byte) ((msgID >>> 8) & 0XFF);
        bytes[1] = (byte) (msgID & 0XFF);
        return ByteBufUtil.hexDump(bytes);
    }

    public int getBodyLength() {
        return bodyLength;
    }

    public void setBodyLength(int bodyLength) {
        this.bodyLength = bodyLength;
    }

    public int getEncrypt() {
        return encrypt;
    }

    public void setEncrypt(int encrypt) {
        this.encrypt = encrypt;
    }

    public boolean isHasSubPakage() {
        return hasSubPakage;
    }

    public void setHasSubPakage(boolean hasSubPakage) {
        this.hasSubPakage = hasSubPakage;
    }

    public String getSimNum() {
        return simNum;
    }

    public void setSimNum(String simNum) {
        this.simNum = simNum;
    }

    public int getFlowNum() {
        return flowNum;
    }

    public void setFlowNum(int flowNum) {
        this.flowNum = flowNum;
    }

    public int getTotalSubPackage() {
        return totalSubPackage;
    }

    public void setTotalSubPackage(int totalSubPackage) {
        this.totalSubPackage = totalSubPackage;
    }

    public int getNumSubPackage() {
        return numSubPackage;
    }

    public void setNumSubPackage(int numSubPackage) {
        this.numSubPackage = numSubPackage;
    }
}
